public WindowLevelExtCommand(
int lowBit,
int highBit,
RasterColor16[] lookupTable,
RasterByteOrder order
)
- (instancetype)initWithLookupTable:(NSArray<LTRasterColor16 *> *)lookupTable lowBit:(NSInteger)lowBit highBit:(NSInteger)highBit order:(LTRasterByteOrder)order NS_DESIGNATED_INITIALIZER;
public WindowLevelExtCommand(
int lowBit,
int highBit,
RasterColor16[] lookupTable,
RasterByteOrder order
);
public:
WindowLevelExtCommand(
int lowBit,
int highBit,
array<RasterColor16>^ lookupTable,
RasterByteOrder order
)
__init__(self,lowBit,highBit,lookupTable,order) # Overloaded constructor
lowBit
Value indicating the low bit used for leveling. 0 <= lowBit <= highBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
highBit
Value indicating the high bit used for leveling. 0 <= lowBit <= highBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale).
lookupTable
Optional 16-bit lookup table that can be used to implement a user defined conversion. For every intensity value between 0 and 2 raised to the power of (HighBit - LowBit + 1) - 1 there should be a corresponding entry in the lookup table that contains a 16-bit RGB quad. If lookupTable is null, the conversion is a normal shift (right or left) and the output image is 8-bit grayscale. If lookupTable is not null, the output image is a 24-bit image.
order
Value indicating the color order if the output image will be 48-bit. If LookupTable is null, this parameter is ignored.
Run the WindowLevelExtCommand on an image.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
public void WindowLevelExtConstructorExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm"));
// Prepare the command
MinMaxBitsCommand MinMaxBits = new MinMaxBitsCommand();
MinMaxBits.Run(image);
MinMaxValuesCommand MinMaxValues = new MinMaxValuesCommand();
MinMaxValues.Run(image);
int Size = (1 << (MinMaxBits.MaximumBit - MinMaxBits.MinimumBit + 1));
RasterColor16[] LookupTable = new RasterColor16[Size];
// fill the first half of the LookupTable with RED.
for (int x = 0; x < Size / 2; x++)
LookupTable[x] = new RasterColor16(RasterColor16.MaximumComponent, 0, 0);
// fill the rest with gray values.
for (int x = Size / 2; x < Size; x++)
{
int y = (UInt16)((x - MinMaxValues.MinimumValue) * RasterColor16.MaximumComponent / (MinMaxValues.MaximumValue - MinMaxValues.MinimumValue));
LookupTable[x] = new RasterColor16(y, y, y);
}
WindowLevelExtCommand command = new WindowLevelExtCommand(MinMaxBits.MinimumBit, MinMaxBits.MaximumBit, LookupTable, RasterByteOrder.Bgr);
command.Run(image);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.